Optimal. Leaf size=100 \[ \frac {\sqrt {\pi } \cos \left (2 a-\frac {b^2}{2 c}\right ) C\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{4 \sqrt {c}}-\frac {\sqrt {\pi } \sin \left (2 a-\frac {b^2}{2 c}\right ) S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{4 \sqrt {c}}+\frac {x}{2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3450, 3448, 3352, 3351} \[ \frac {\sqrt {\pi } \cos \left (2 a-\frac {b^2}{2 c}\right ) \text {FresnelC}\left (\frac {b+2 c x}{\sqrt {\pi } \sqrt {c}}\right )}{4 \sqrt {c}}-\frac {\sqrt {\pi } \sin \left (2 a-\frac {b^2}{2 c}\right ) S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{4 \sqrt {c}}+\frac {x}{2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3351
Rule 3352
Rule 3448
Rule 3450
Rubi steps
\begin {align*} \int \cos ^2\left (a+b x+c x^2\right ) \, dx &=\int \left (\frac {1}{2}+\frac {1}{2} \cos \left (2 a+2 b x+2 c x^2\right )\right ) \, dx\\ &=\frac {x}{2}+\frac {1}{2} \int \cos \left (2 a+2 b x+2 c x^2\right ) \, dx\\ &=\frac {x}{2}+\frac {1}{2} \cos \left (2 a-\frac {b^2}{2 c}\right ) \int \cos \left (\frac {(2 b+4 c x)^2}{8 c}\right ) \, dx-\frac {1}{2} \sin \left (2 a-\frac {b^2}{2 c}\right ) \int \sin \left (\frac {(2 b+4 c x)^2}{8 c}\right ) \, dx\\ &=\frac {x}{2}+\frac {\sqrt {\pi } \cos \left (2 a-\frac {b^2}{2 c}\right ) C\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{4 \sqrt {c}}-\frac {\sqrt {\pi } S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \sin \left (2 a-\frac {b^2}{2 c}\right )}{4 \sqrt {c}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.10, size = 97, normalized size = 0.97 \[ \frac {\sqrt {\pi } \cos \left (2 a-\frac {b^2}{2 c}\right ) C\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )-\sqrt {\pi } \sin \left (2 a-\frac {b^2}{2 c}\right ) S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )+2 \sqrt {c} x}{4 \sqrt {c}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.71, size = 93, normalized size = 0.93 \[ \frac {\pi \sqrt {\frac {c}{\pi }} \cos \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right ) \operatorname {C}\left (\frac {{\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{c}\right ) - \pi \sqrt {\frac {c}{\pi }} \operatorname {S}\left (\frac {{\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{c}\right ) \sin \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right ) + 2 \, c x}{4 \, c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [C] time = 0.52, size = 122, normalized size = 1.22 \[ \frac {1}{2} \, x - \frac {\sqrt {\pi } \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x + \frac {b}{c}\right )} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {i \, b^{2} - 4 i \, a c}{2 \, c}\right )}}{8 \, \sqrt {c} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}} - \frac {\sqrt {\pi } \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x + \frac {b}{c}\right )} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {-i \, b^{2} + 4 i \, a c}{2 \, c}\right )}}{8 \, \sqrt {c} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.04, size = 72, normalized size = 0.72 \[ \frac {x}{2}+\frac {\sqrt {\pi }\, \left (\cos \left (\frac {-4 c a +b^{2}}{2 c}\right ) \FresnelC \left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )+\sin \left (\frac {-4 c a +b^{2}}{2 c}\right ) \mathrm {S}\left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )\right )}{4 \sqrt {c}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [C] time = 1.35, size = 124, normalized size = 1.24 \[ -\frac {4^{\frac {1}{4}} \sqrt {2} \sqrt {\pi } {\left ({\left (\left (i - 1\right ) \, \cos \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right ) + \left (i + 1\right ) \, \sin \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right )\right )} \operatorname {erf}\left (\frac {2 i \, c x + i \, b}{\sqrt {2 i \, c}}\right ) + {\left (\left (i + 1\right ) \, \cos \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right ) + \left (i - 1\right ) \, \sin \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right )\right )} \operatorname {erf}\left (\frac {2 i \, c x + i \, b}{\sqrt {-2 i \, c}}\right )\right )} c^{\frac {3}{2}} - 16 \, c^{2} x}{32 \, c^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int {\cos \left (c\,x^2+b\,x+a\right )}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.94, size = 83, normalized size = 0.83 \[ \frac {x}{2} + \frac {\sqrt {\pi } \left (- \sin {\left (2 a - \frac {b^{2}}{2 c} \right )} S\left (\frac {2 b + 4 c x}{2 \sqrt {\pi } \sqrt {c}}\right ) + \cos {\left (2 a - \frac {b^{2}}{2 c} \right )} C\left (\frac {2 b + 4 c x}{2 \sqrt {\pi } \sqrt {c}}\right )\right ) \sqrt {\frac {1}{c}}}{4} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________